<?php 
	//---  获得post数据  ---
	$friendID = $_REQUEST['FriendID'];
	$userID = $_REQUEST['UserID'];
	$UUID = $_REQUEST['UUID'];
	//－－－  连接服务器  －－－
	$con = mysql_connect("127.0.0.1:3306","root","1qazse4");
	$DataName = 'ShareNavigation';
	if(!$con)
	{
		die('无法连接远程服务器: '.mysql_error);
	}
	//－－－  链接指定数据库  －－－
	mysql_query("SET NAMES UTF8");
	mysql_select_db($DataName,$con);
	$query = "INSERT  INTO Friend 
		(UUID,UserID,FriendID,IsAccept) 
		VALUES (\"$UUID\",\"$userID\",\"$friendID\",1)";
	$query1 = "UPDATE Friend SET IsAccept = 1
			WHERE UserID = \"$friendID\" && FriendID =\"$userID\" ";
	$result = mysql_query($query);
	$result1 = mysql_query($query1);
	//－－－  如果有结果，则没有申请为好友过  －－－
	if(!$result || !$result1)
	{
		echo 'FALSE';
	}
	else 
	{
		echo 'TRUE';
	}
	
	mysql_close($con);
?>